/**
 * Created by IntelliJ IDEA.
 * User: caporegim
 * Date: 08.08.12
 * Time: 23:32
 * To change this template use File | Settings | File Templates.
 */
public class Generator extends Thread {
    private Fibonachi fibonachi;

    public Generator(Fibonachi fibonachi) {
        this.fibonachi = fibonachi;
    }

    @Override
    public void run() {
        int i = 0;

        while (i++ < 10) {
            Thread.currentThread().setPriority(i);

            System.out.println(getName() + " " + fibonachi.next());
        }
    }
}
